// 首页
// https://www.wyjdd.com/

// 登录
// https://www.wyjdd.com/login/index.html

// 接单
// https://www.wyjdd.com/task/match.html



// 首页
let token = Android.getMap("token")
document.cookie = token




function getParameterHandler() {
    let headers = {
        "cookie": parameter.getMap("token")
    }
    let body = {
        "class_id": "1,2,3,4,5,6,7,8"
    }
    let strUrl = ``
    let url = parameter.getMap("url") + strUrl
    return {
        mediaType: "form",
        requestType: "POST",
        url: url,
        headers: JSON.stringify(headers),
        body: JSON.stringify(body)
    }
}
getParameterHandler()



function getResponse() {
    let res = response.getMap("res")
    let code = "500"
    let message = "接单中"
    let dataKey = ""
    let dataValue = ""

    try {
        res = JSON.parse(res)
        if (res["status"] == 1) {
            code = "200"
            message = res["msg"]
        } else {
            code = "500"
            message = res["msg"]
        }
    } catch (e) {
        code = "300"
        message = "登录过期"
    }

    return {
        code: code,
        message: message,
        dataKey: dataKey,
        dataValue: dataValue
    }
}
getResponse()

// {
// 	"status": 0,
// 	"msg": "暂无可接手任务"
// }